package com.winapi.project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.winapi.project.model.dto.orders.OrdersAddRequest;
import com.winapi.project.model.vo.OrderVO;
import com.winapi.winapicommon.model.entity.Orders;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 张莹莹
* @description 针对表【order(订单表)】的数据库操作Service
* @createDate 2023-12-18 00:37:09
*/
public interface OrderService extends IService<Orders> {

    /**
     * 查询出前五名购买次数最多的接口
     * @return
     */
    List<OrderVO> listTopBuyInterfaceInfo();

    /**
     * 添加订单
     * @param ordersAddRequest
     * @param request
     * @return
     */
    OrderVO addOrder(OrdersAddRequest ordersAddRequest, HttpServletRequest request);

    void updateStatusByOrderNo(String orderNo, Integer orderStatus);

    /**
     * 按照一定的时间范围内查询未支付订单
     * @param minutes
     * @return
     */
    List<Orders> getNoPayOrderByDuration(int minutes);

    Orders getOrdersByOrderNumber(String orderNumber);
}
